package ebj.common.java8.javafx;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class JavaFxApp extends Application {

	@Override
	public void start(Stage primaryStage) throws Exception {
		Button button = new Button();
		button.setText("Martin JavaFX2 Demo");
		button.setOnAction(
//				new EventHandler<ActionEvent>() {
//
//			@Override
//			public void handle(ActionEvent event) {
//				primaryStage.setTitle("λEs Rock!");
//			}
//		}
		(ActionEvent actionEvent) -> {
			primaryStage.setTitle("Martin Rock!");
		});
		StackPane stackPane = new StackPane();
		stackPane.getChildren().add(button);
		Scene scene = new Scene(stackPane, 200, 50);
		primaryStage.setScene(scene);
		primaryStage.show();
	}

	public static void main(String[] args) {
		launch(args);
	}
}
